import com.sh.algorithm.solution1;

import java.util.Scanner;

/**
 * @author veviz
 * @description 启动脚本
 * @create 2019-08-14  0:12
 */
public class StartUp {

    /**
     *@Description 启动脚本的主函数
     *@Para
     *@Author veviz
     *@Date 2019/8/14
     */
    private static int [] test1(){
        solution1 solution1 = new solution1();
        int target = 9;
        int [] nums = new int[]{2,7,11,15};
        int [] result = solution1.twoSum(nums,target);
        return result;
    }

    public static void test2(){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            String str = sc.nextLine().trim();
            int length = 0;
            for(int i=str.length()-1;i > -1; i--){
                if(str.charAt(i) != ' '){
                    length ++;
                }else{
                    break;
                }
            }
            System.out.println(length);
        }
    }

    public static void main(String [] args){
        test2();
        //System.out.println(test1());
    }
}